<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>韩城市综合行政执法局业务审批管理系统</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="__ADMIN__/bower_components/bootstrap/dist/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="__ADMIN__/bower_components/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="__ADMIN__/bower_components/Ionicons/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="__ADMIN__/dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="__ADMIN__/dist/css/skins/_all-skins.min.css">
  <!-- Morris chart -->
  <link rel="stylesheet" href="__ADMIN__/bower_components/morris.js/morris.css">
  <!-- jvectormap -->
  <link rel="stylesheet" href="__ADMIN__/bower_components/jvectormap/jquery-jvectormap.css">
  <!-- Date Picker -->
  <link rel="stylesheet" href="__ADMIN__/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
  <!-- Daterange picker -->
  <link rel="stylesheet" href="__ADMIN__/bower_components/bootstrap-daterangepicker/daterangepicker.css">
  <!-- bootstrap wysihtml5 - text editor -->
  <link rel="stylesheet" href="__ADMIN__/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
  <!-- 自定义样式 -->
  <link rel="stylesheet" href="__ADMIN__/css/style.css">
  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
  <!-- jQuery 3 -->
  <script src="__ADMIN__/bower_components/jquery/dist/jquery.min.js"></script>
  <script src="__PLUS__/layer/layer.js"></script>
  <!-- echarts -->
  <script src="__ADMIN__/js/echarts.min.js"></script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

  <!-- 头部 -->
  {include file="common/header"}
  <!-- //头部 -->

  <!-- 左侧导航 -->
  {include file="common/left"}
  <!-- /左侧导航 -->

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper" style="overflow: hidden;">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        业务统计

      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 系统</a></li>
        <li class="active">业务统计</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="row">
        <div class="col-xs-12">
          <div class="box">

            <!-- /.box-header -->
            <div class="col-md-12" style="margin-top: 30px;">
              <!-- Custom Tabs -->
              <div class="nav-tabs-custom">
                <ul class="nav nav-tabs">
                  <li class=""><a href="{:url('business/countdays')}" >今日统计</a></li>
                  <li class="active"><a href="{:url('business/countweeks')}" >本周统计</a></li>
                  <li class=""><a href="{:url('business/countmonth')}" >本月统计</a></li>
                  <li class=""><a href="{:url('business/countyears')}" >年度统计</a></li>
                  <li class="pull-right"><a href="#" class="text-muted"><i class="fa fa-gear"></i></a></li>
                </ul>
                <div class="tab-content">

                  <div class="tab-pane active" id="tab_2">
                    <div id="chart2" style="width: 100%; height: 400px;"></div>
                    <script type="text/javascript">
                        // 基于准备好的dom，初始化echarts实例
                        var myChart = echarts.init(document.getElementById('chart2'));

                        option = {
                            title: {
                                text: '受理统计',

                                left: 'center'
                            },
                            tooltip : {
                                trigger: 'item',
                                formatter: "{a} <br/>{b} : {c} ({d}%)"
                            },
                            legend: {
                                // orient: 'vertical',
                                // top: 'middle',
                                bottom: 10,
                                left: 'center',
                                data: ['本周受理', '本周办结']
                            },
                            series : [
                                {
                                    type: 'pie',    //图表样式  bar柱状图,pie饼状图
                                    radius : '70%',   //图表尺寸
                                    center: ['50%', '50%'],  //图表水平垂直位置
                                    selectedMode: 'single',
                                    data:[
                                        {
                                            value:{$weeks.count},
                                        name: '本周受理',
                            label: {
                            normal: {
                                formatter: [
                                    ' {title|{b} }{abg|}',
                                    '{weatherHead|{$weeks.count}}'
                                ].join('\n'),
                                    backgroundColor: '#fff',
                                    borderColor: '#777',
                                    borderWidth: 1,
                                    borderRadius: 4,
                                    rich: {
                                    title: {
                                        color: '#eee',
                                            align: 'center'
                                    },
                                    abg: {
                                        backgroundColor: '#333',
                                            width: '100%',
                                            align: 'right',
                                            height: 25,
                                            borderRadius: [4, 4, 0, 0]
                                    },
                                    weatherHead: {
                                        color: '#68252A',
                                            height: 24,
                                            align: 'center'
                                    },
                                }
                            }
                        }
                        },
                        {
                            value:{$weeks.counte},
                            name: '本周办结',
                                label: {
                            normal: {
                                formatter: [
                                    ' {title|{b} }{abg|}',
                                    '{weatherHead|{$weeks.counte}}'
                                ].join('\n'),
                                    backgroundColor: '#fff',
                                    borderColor: '#777',
                                    borderWidth: 1,
                                    borderRadius: 4,
                                    rich: {
                                    title: {
                                        color: '#eee',
                                            align: 'center'
                                    },
                                    abg: {
                                        backgroundColor: '#333',
                                            width: '100%',
                                            align: 'right',
                                            height: 25,
                                            borderRadius: [4, 4, 0, 0]
                                    },
                                    weatherHead: {
                                        color: '#2A4555',
                                            height: 24,
                                            align: 'center'
                                    }
                                }
                            }
                        }
                        }
                        ],
                        itemStyle: {
                            emphasis: {
                                shadowBlur: 10,
                                    shadowOffsetX: 0,
                                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                        }
                        ]
                        };


                        // 使用刚指定的配置项和数据显示图表。
                        myChart.setOption(option);
                    </script>
                    <table class="table table-hover text-center">
                      <tr>
                        <th>ID</th>
                        <th>编号</th>
                        <th>单位</th>
                        <th>电话</th>
                        <th>类型</th>
                        <th>状态</th>
                        <th>日期</th>
                      </tr>
                      {volist name="weeks['data']" id="vo"}

                      <tr>
                        <td>{$vo.bus_id}</td>
                        <td>{$vo.bus_no}</td>
                        <td><a class="show" data-id="{$vo.bus_id}" cate-id="{$vo.cate_name}" href="javascript:;">{$vo.bus_name}</a></td>
                        <td>{$vo.bus_tel}</td>
                        <td>{$vo.cate_name}</td>
                        <td><a href="#" {if condition="$vo['bus_status'] neq 5"}class="label label-danger" {/if}{if condition="$vo['bus_status'] eq 5"}class="label label-primary" {/if}>{if condition="$vo['bus_status'] neq 5"}受理中{/if}{if condition="$vo['bus_status'] eq 5"}已办结{/if}</a></td>
                        <td>{$vo.bus_create_time|date="Y-m-d H:i:s",###}</td>
                      </tr>
                      {/volist}
                    </table>
                  </div>
                  <div style="text-align:right;margin-top:10px;">
                    {$weeks['data']->render()}	                </div>
                  <!-- /.tab-pane -->
                </div>
                <!-- /.tab-content -->
              </div>
              <!-- nav-tabs-custom -->
            </div>
          </div>
          <!-- /.box -->
        </div>
      </div>

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  <!-- 底部 -->
  {include file="common/footer"}
  <!-- /底部 -->
  <div id="showbox" style="display:none;">
    <table  class="table table-bordered table-hover dataTable" role="grid" aria-describedby="example2_info">
      <tbody>
      <tr role="row" class="even">
        <td style="width: 50%;"><label class="show_label">业务编号:</label><span  class="" id="no"  ></span></td>
        <td style="width: 50%;"><label class="show_label">申请单位:</label><span  class="" id="name"  ></span></td>
      </tr>
      <tr role="row" class="even">
        <td style="width: 50%;"><label class="show_label">业务类型:</label><span  class="" id="cate_id"  ></span></td>
        <td style="width: 50%;"><label class="show_label">联系电话:</label><span  class="" id="tel"  ></span></td>
      </tr>
      <tr role="row" class="even">
        <td style="width: 50%;"><label class="show_label">所属区域:</label><span  class="" id="area_id"  ></span></td>
        <td style="width: 50%;"><label class="show_label">详细地址:</label><span  class="" id="address"  ></span></td>
      </tr>
      </tbody>
    </table>
    <div id="content" class="show_content"></div>
    <div id="kanyan_show" class="show_kanyan text-center"></div>
    <div id="message_show">
      <table class="table table-hover text-center">
        <tbody>
        <tr id="til">
          <th>审核状态</th>
          <th>审核部门</th>
          <th>审核人员</th>
          <th>审核详情</th>
          <th>审核时间</th>
        </tr>
        <!--<tr>-->
        <!--<td></td>-->
        <!--<td></td>-->
        <!--<td></td>-->
        <!--<td></td>-->
        <!--</tr>-->
        </tbody></table>
    </div>

    <!-- /.box-footer -->
  </div>
  <!-- ./wrapper -->
  <script>

      // 显示业务详情
      $('.show').on('click', function(){

          $.ajax({
              url: "{:url('business/ajaxShow')}",
              type: 'POST',
              dataType: 'json',
              data: {
                  id:$(this).attr('data-id'),
                  cate_id:$(this).attr('cate-id')
              }
          })
              .done(function(res) {
                  console.log(res);
                  if(res.ECODE== 200){

                      $('#no').text(res.MSG.base.bus_no);
                      $('#name').text(res.MSG.base.bus_name);
                      $('#tel').text(res.MSG.base.bus_tel);
                      $('#cate_id').text(res.MSG.base.cate_name);
                      $('#area_id').text(res.MSG.base.area_name);
                      $('#address').text(res.MSG.base.bus_address);
                      $('#content').html(res.MSG.base.bus_content);
                      var kanyan_img="<img src='"+res.MSG.base.bus_thumb+"'>";
                      // $('#kanyan_show').afterAll().remove();
                      $('#kanyan_show').append(kanyan_img);
                      $('#pass').attr('pname-id',res.MSG.base.pos_name);
                      $('#pass').attr('status-id',res.MSG.base.bus_status);
                      $('#back').attr('pname-id',res.MSG.base.pos_name);
                      $('#pass').attr('data-id',res.MSG.base.bus_id);
                      $('#back').attr('status-id',res.MSG.base.bus_status);
                      $('#back').attr('data-id',res.MSG.base.bus_id);
                      $('#bakkanyan').attr('data-id',res.MSG.base.bus_id);
                      $('#bakkanyan').attr('status-id',res.MSG.base.bus_status);

                      var info = res.MSG.info;
                      var info_html = "";
                      if(info){
                          for(var i=0;i<info.length;i++){
                              var num=info[i].mstatus;
                              info_html += '<tr>';
                              info_html += num == 1 ? '<td><span class="label label-success">通过</span></td>' : '<td><span class="label label-danger">退回</span></td>';
                              info_html += '<td>'+ info[i].position_name +'</td>';
                              info_html += '<td>'+ info[i].name +'</td>';
                              info_html += '<td>'+ info[i].content +'</td>';
                              info_html += '<td>'+ info[i].create_time +'</td>';
                              info_html += '</tr>';
                          }
                      }
                      $('#til').nextAll().remove();
                      $('#til').after(info_html);

                      //页面层
                      layer.open({
                          type: 1,
                          title: '业务审核',
                          skin: 'layui-layer-rim', //加上边框
                          area: ['80%','80%'], //宽高
                          content: $('#showbox')
                      });
                  }

              });
      });







  </script>

  <!-- Bootstrap 3.3.7 -->
  <script src="__ADMIN__/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  <!-- Morris.js charts -->
  <script src="__ADMIN__/bower_components/raphael/raphael.min.js"></script>
  <script src="__ADMIN__/bower_components/morris.js/morris.min.js"></script>
  <!-- Sparkline -->
  <script src="__ADMIN__/bower_components/jquery-sparkline/dist/jquery.sparkline.min.js"></script>
  <!-- jvectormap -->
  <script src="__ADMIN__/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
  <script src="__ADMIN__/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
  <!-- jQuery Knob Chart -->
  <script src="__ADMIN__/bower_components/jquery-knob/dist/jquery.knob.min.js"></script>
  <!-- daterangepicker -->
  <script src="__ADMIN__/bower_components/moment/min/moment.min.js"></script>
  <script src="__ADMIN__/bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
  <!-- datepicker -->
  <script src="__ADMIN__/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
  <!-- Bootstrap WYSIHTML5 -->
  <script src="__ADMIN__/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
  <!-- Slimscroll -->
  <script src="__ADMIN__/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
  <!-- FastClick -->
  <script src="__ADMIN__/bower_components/fastclick/lib/fastclick.js"></script>
  <!-- AdminLTE App -->
  <script src="__ADMIN__/dist/js/adminlte.min.js"></script>
  <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
  <script src="__ADMIN__/dist/js/pages/dashboard.js"></script>
  <!-- AdminLTE for demo purposes -->
  <script src="__ADMIN__/dist/js/demo.js"></script>
</body>
</html>
